# Maintainer: Pedro Lucas Porcellis <porcellis@eletrotupi.com>
pkgname=powerctl
pkgver=1.1
pkgrel=4
pkgdesc="CLI tool to manage Linux power management states"
url="https://sr.ht/~sircmpwn/powerctl/"
arch="x86_64 aarch64" # Hare
license="GPL-3.0-only"
makedepends="hare scdoc"
subpackages="$pkgname-doc"
source="
	$pkgname-$pkgver.tar.gz::https://git.sr.ht/~sircmpwn/powerctl/archive/$pkgver.tar.gz
	new-hare-strings.patch
	getopts-fs-flags.patch
"
install="$pkgname.post-install"
# Hare does not support PIE
options="$options !check suid"

build() {
	make -j1 PREFIX=/usr
}

package() {
	make DESTDIR="$pkgdir" PREFIX=/usr install
}

sha512sums="
02fec6e8bab802cbb7436cb1ea378cba2ddf84ac1dc129f10ccb5ccad91f5d44d56373871ff14b23cc81eddf22abfdc2f92c87baece94fbba7aaf91f1654dc1a  powerctl-1.1.tar.gz
123c185190a1b8cd96d4d4edb6d3e5101f4884cbf2f83fc00bc3218bccc101733c1068e77579c942f5acb3e5573071257b76d38b1594d066def3c1c2febb9b2d  new-hare-strings.patch
db6c2331256aca10908cc43cc08f17ca45c3a6f4966315a95ba99652ff09d8d62f632312e8c3b985fd95eb96509efbce45e89fe10a8f9f279bde509c4d9bc31d  getopts-fs-flags.patch
"
